package dcedit.util;

// Import Java SDK Classes
import java.awt.Color;

/** Colors class */
public class Colors {
   /** Private Constructor */
   private Colors() {} // constructor

   /** Foreground-color for the application */
   private static Color appFontColor;

   /** Background-color for the application */
   private static Color appBackgroundColor;

   /** Foreground-color for menus */
   private static Color menuFontColor;

   /** Background-color for menus */
   private static Color menuBackgroundColor;

   /** Foreground-color for text areas */
   private static Color tabForegroundColor;

   /** Background-color for text areas */
   private static Color tabBackgroundColor;

   /** Highlight-color for text areas */
   private static Color tabHighlightColor;

   /** HTML highlight color */
   private static Color htmlForegroundColor;

   /* Java highlight color */
   private static Color javaForegroundColor;

   /** SQL highlight color */
   private static Color sqlForegroundColor;

   /** Single-comment line color */
   private static Color singleCommentLineForegroundColor;

   /** Multi-comment line color */
   private static Color multiCommentLineForegroundColor;

   /** Java-doc comment line color */
   private static Color javaDocCommentLineForegroundColor;

   /** isDark method */
   public static boolean isDark(Color color) {
      if(color == null) return false;
      else if(color.getRed() + color.getBlue() + color.getGreen() > Constants.DARK_COLOR_THRESHOLD) return false;
      else return true;
   } // END isDark

   // APP COLORS

   /** getAppForegroundColor method */
   public static Color getAppFontColor() {
      return appFontColor;
   } // END getAppFontColor

   /** setAppFontColor method */
   public static void setAppFontColor(Color color) {
      if(null != color) appFontColor = color;
   } // END setAppFontColor

   /** getAppBackgroundColor method */
   public static Color getAppBackgroundColor() {
      return appBackgroundColor;
   } // END getAppBackgroundColor

   /** setAppBackgroundColor method */
   public static void setAppBackgroundColor(Color color) {
      if(null != color) appBackgroundColor = color;
   } // END setAppBackgroundColor

   // MENU COLORS

   /** getMenuForegroundColor method */
   public static Color getMenuFontColor() {
      return menuFontColor;
   } // END getMenuFontColor

   /** setMenuFontColor method */
   public static void setMenuFontColor(Color color) {
      if(null != color) menuFontColor = color;
   } // END setMenuFontColor

   /** getMenuBackgroundColor method */
   public static Color getMenuBackgroundColor() {
      return menuBackgroundColor;
   } // END getMenuBackgroundColor

   /** setMenuBackgroundColor method */
   public static void setMenuBackgroundColor(Color color) {
      if(null != color) menuBackgroundColor = color;
   } // END setMenuBackgroundColor

   // TAB COLORS

   /** getTabForegroundColor method */
   public static Color getTabForegroundColor() {
      return tabForegroundColor;
   } // END getTabForegroundColor

   /** setTabForegroundColor method */
   public static void setTabForegroundColor(Color color) {
      if(null != color) tabForegroundColor = color;
   } // END setTabForegroundColor

   /** getTabBackgroundColor method */
   public static Color getTabBackgroundColor() {
      return tabBackgroundColor;
   } // END getTabBackgroundColor

   /** setTabBackgroundColor method */
   public static void setTabBackgroundColor(Color color) {
      if(null != color) tabBackgroundColor = color;
   } // END setTabBackgroundColor

   /** getTabHighlightColor method */
   public static Color getTabHighlightColor() {
      return tabHighlightColor;
   } // END getTabHighlightColor

   /** setTabHighlightColor method */
   public static void setTabHighlightColor(Color color) {
      if(null != color) tabHighlightColor = color;
   } // END setTabHighlightColor

   // HIGHLIGHT COLORS

   /** getHtmlForegroundColor method */
   public static Color getHtmlForegroundColor() {
      return htmlForegroundColor;
   } // END getHtmlForegroundColor

   /** setHtmlForegroundColor method */
   public static void setHtmlForegroundColor(Color color) {
      if(null != color) htmlForegroundColor = color;
   } // END setHtmlForegroundColor

   /** getJavaForegroundColor method */
   public static Color getJavaForegroundColor() {
      return javaForegroundColor;
   } // END getJavaForegroundColor

   /** setJavaForegroundColor method */
   public static void setJavaForegroundColor(Color color) {
      if(null != color) javaForegroundColor = color;
   } // END setJavaForegroundColor

   /** getSqlForegroundColor method */
   public static Color getSqlForegroundColor() {
      return sqlForegroundColor;
   } // END getSqlForegroundColor

   /** setSqlForegroundColor method */
   public static void setSqlForegroundColor(Color color) {
      if(null != color) sqlForegroundColor = color;
   } // END setSqlForegroundColor

   // COMMENT LINE COLORS

   /** getSingleCommentLineForegroundColor method */
   public static Color getSingleCommentLineForegroundColor() {
      return singleCommentLineForegroundColor;
   } // END getSingleCommentLineForegroundColor

   /** setSingleCommentLineForegroundColor method */
   public static void setSingleCommentLineForegroundColor(Color color) {
      if(null != color) singleCommentLineForegroundColor = color;
   } // END setSingleCommentLineForegroundColor

   /** getMultiCommentLineColor method */
   public static Color getMultiCommentLineForegroundColor() {
      return multiCommentLineForegroundColor;
   } // END getMultiCommentLineForegroundColor

   /** setMultiCommentLineForegroundColor method */
   public static void setMultiCommentLineForegroundColor(Color color) {
      if(null != color) multiCommentLineForegroundColor = color;
   } // END setMultiCommentLineForegroundColor

   /** getJavaDocCommentLineForegroundColor method */
   public static Color getJavaDocCommentLineForegroundColor() {
      return javaDocCommentLineForegroundColor;
   } // END getJavaDocCommentLineForegroundColor

   /** setJavaDocCommentLineForegroundColor method */
   public static void setJavaDocCommentLineForegroundColor(Color color) {
      if(null != color) javaDocCommentLineForegroundColor = color;
   } // END setJavaDocCommentLineForegroundColor
} // END class Colors